Skip to main content

Get IMAP Messages

AutomatR.Mail.GetIMAPMessages

The "Get IMAP Messages" activity in AutomatR allows you to automate the retrieval of IMAP email messages from a designated server. This activity is part of the Mail Activities Pack, enhancing automation processes related to email management.

Properties

NameDescription
Input
EmailSpecify the email account from which you want to retrieve the message. String variables containing the email account.
HostSpecify the host name as "imap.gmail.com" to establish a connection with the IMAP server. String variables containing the host name.
PasswordSpecify the password of the email account used to retrieve the message. String variables containing the password.
PortSpecify the port used to connect to the email server and retrieve the email message. Integer variables containing the port number.
TopSpecify the number of email messages to be retrieved from the email server. Integer variables containing the number of messages.
Use SSLSpecify the SSL encryption type to be used for the connection with the email server. Boolean variables determining whether to use SSL.
Body ContainsSpecify the content that the mail body should contain for the messages to be retrieved. String variables containing the desired content.
Optional
DelayEnter the wait time in seconds (Example: 5 seconds i.e., 5) to start the activity. Integer variables containing the delay duration.
Has AttachmentsIf checked, only retrieve messages with attachments. Boolean variables determining whether to retrieve messages with attachments.
Mark As ReadIf checked, retrieved messages will be marked as read. Boolean variables determining whether to mark messages as read.
Only UnreadIf checked, only retrieve unread messages. Boolean variables determining whether to retrieve only unread messages.
Subject ContainsSpecify the content that the subject line should contain for the messages to be retrieved. String variables containing the desired content.
Text OutputIf checked, retrieve messages as text output. Boolean variables determining whether to retrieve messages as text.
Output
ExceptionIf an exception occurs while executing a sequence, the exception can be stored in a string variable for further processing. String variables containing the exception message.
MessagesThe retrieved messages are stored as a collection of MailMessage objects. List variables containing the retrieved messages.
ResultReturns true or false based on the mail message retrieved. Boolean variables indicating the success of the operation.

How to use:

  1. Drag and drop the "Get IMAP Messages" activity onto the workflow.
  2. Configure the properties by specifying the email account, host, password, port, and other optional parameters.
  3. Execute the workflow to retrieve email messages based on the specified criteria.
  4. Retrieve the result, exception, and messages for further processing in the workflow.

Example: Consider an example where the "Get IMAP Messages" activity is used to retrieve unread messages with attachments from the email account "example@gmail.com":

Get IMAP Messages:
Email: "example@gmail.com"
Host: "imap.gmail.com"
Password: "your_password"
Port: 993
Top: 5
Only Unread: true
Has Attachments: true
Result: isMessagesRetrieved
Messages: retrievedMessages

In this example, the activity retrieves the top 5 unread messages with attachments from the specified email account and server. The result of the operation (success or failure) is stored in the Boolean variable "isMessagesRetrieved," and the retrieved messages are stored in the list variable "retrievedMessages" for further handling in the workflow.